//
//  AXFregulationsTableViewCell.m
//  AIXF
//
//  Created by mac on 2017/7/14.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "AXFregulationsTableViewCell.h"
#import <UIImageView+WebCache.h>
@interface AXFregulationsTableViewCell ()
//背景图片
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
//背景圆圈
@property (weak, nonatomic) IBOutlet UIImageView *roundImageView;
//优惠券价格类型
@property (weak, nonatomic) IBOutlet UILabel *value;
//使用或者未使用图片
@property (weak, nonatomic) IBOutlet UIImageView *useImageView;
//优惠券名称
@property (weak, nonatomic) IBOutlet UILabel *name;
//起始时间
@property (weak, nonatomic) IBOutlet UILabel *start_time;
//结束时间
@property (weak, nonatomic) IBOutlet UILabel *end_time;
//描述
@property (weak, nonatomic) IBOutlet UILabel *descrdup;



@end
@implementation AXFregulationsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
 
}




-(void)setModel:(AXFMyCouponModel *)model{
    _model = model;
    dispatch_async(dispatch_get_main_queue(), ^{
        
        //已使用图片
        if (!model.is_userd) {
            self.useImageView.image = [UIImage imageNamed:@"v2_coupon_used"];
        }else{
            self.useImageView.image = [UIImage imageNamed:@"v2_coupon_outdated"];
        }
        
        //背景图片
        if (model.is_bg) {
            self.bgImageView.image = [UIImage imageNamed:@"v2_coupon_yellow"];
            self.roundImageView.image = [UIImage imageNamed:@"v2_shopNoBorder"];
        }else{
            self.bgImageView.image = [UIImage imageNamed:@"v2_coupon_gray"];
            self.roundImageView.image = [UIImage imageNamed:@"v2_noselected"];
        
        }
        
        self.value.text = model.value;
        self.name.text = model.name;
        self.start_time.text = model.start_time;
        self.end_time.text = model.end_time;
        self.descrdup.text = model.descrdup;
        
        
    });
}


@end
